package cate.game.pvp.ladder.common;

import java.util.Calendar;
import java.util.Date;

public class LadderSeason {
    public static boolean isSunday(Date date){
        Calendar cal = Calendar.getInstance();
        if(null != date) {
            cal.setTime(date);
        }
        int data = cal.get(Calendar.DAY_OF_WEEK);
        return data == Calendar.SUNDAY;
    }

    public static boolean isBetweenHour(Date date){
        Calendar cal = Calendar.getInstance();
        if (null != date) {
            cal.setTime(date);
            int hour = cal.get(Calendar.HOUR_OF_DAY);
            if (hour >= 23) {
                return true;
            }
        }
        return  false;
    }

    public static boolean inSeason(Date date) {
        if (isSunday(date) && isBetweenHour(date)) {
            return false;
        }
        return true;
    }

}
